using System;
using System.Runtime.Serialization;

namespace Pegasus.UnitTests.Runtime.Serialization.Formatters.Xml.XmlFormatter2Tests
{
	/// <summary>
	/// This object implements the ISerializable interface but does not have the Serializable attribute
	/// This is not allowed and the Formatter should thow an error.
	/// </summary>
	public class NonserializationISerializableObject : ISerializable
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="T:NonserializationISerializableObject"/> class.
		/// </summary>
		public NonserializationISerializableObject()
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="T:NonserializationISerializableObject"/> class.
		/// </summary>
		/// <param name="info">The info.</param>
		/// <param name="context">The context.</param>
		protected NonserializationISerializableObject( SerializationInfo info, StreamingContext context )
		{
		}

		/// <summary>
		/// Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo"></see> with the data needed to serialize the target object.
		/// </summary>
		/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"></see> to populate with data.</param>
		/// <param name="context">The destination (see <see cref="T:System.Runtime.Serialization.StreamingContext"></see>) for this serialization.</param>
		/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
		public void GetObjectData( SerializationInfo info, StreamingContext context )
		{
		}
	}
}
